﻿using System.Collections.Generic;

namespace smp.QueryDb
{
    internal class PagedResult<TViewModel> : IPagedResult<TViewModel>
    {
        internal PagedResult()
        {
            Results = new List<TViewModel>();
        }

        internal PagedResult(List<TViewModel> results)
        {
            Results = results;
        }
        
        #region Implementation of IPagedResult<TViewModel>

        public List<TViewModel> Results { get; private set; }

        public int TotalRecords { get; internal set; }

        #endregion

        internal void Add(object model)
        {
            Results.Add((TViewModel) model);
        }
    }
}
